package graph.visitors;

import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.TypeDeclaration;

public class TypeDeclarationSearcher extends ASTVisitor {
	
	private String _name = null;
	
	private TypeDeclaration _class = null;
	
	public TypeDeclarationSearcher(String name) {
		_name = name;
	}
	
	@Override
	public boolean visit(TypeDeclaration node) {
		if (node.getName().getFullyQualifiedName().equals(_name)
			&& !node.isInterface()) {
			_class = node;
			return true;
		}
		return super.visit(node);
	}
	
	public TypeDeclaration getFoundClass() {
		return _class;
	}

}
